<?php

//判断是否为命令行
$cli=false;
if(strcmp(php_sapi_name (),"cli")==0){
    $cli=true;
}

if($cli){
$linebr="\n";
}else{
    $linebr= "<br/>";
}
//函数参数约束
function  gg(int $num,string $name):string{
    global $linebr;
    print("输出:".$num.$linebr.$name."");

    return $name;
}
$return=gg(num:10,name:"zhongguo");
echo $linebr;
var_dump($return);


$return2=gg(name:"lili",num:10);
echo $linebr;
var_dump($return2);



